package com.iemp.service.impl.list;

import com.iemp.bean.example.AccountExample;
import com.iemp.bean.example.RoleExample;
import com.iemp.bean.impl.Account;
import com.iemp.bean.impl.Role;
import com.iemp.dao.RoleMapper;
import com.iemp.service.base.AbstractListService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl extends AbstractListService<Role> {

    private final RoleMapper mapper;

    public RoleServiceImpl(RoleMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public List findAllByList() {
        return mapper.selectByExample(new RoleExample());
    }

    @Override
    public Integer deleteById(Integer id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public Role selectById(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertSelective(Role entity) {
        return mapper.insertSelective(entity);
    }

    @Override
    public int updateByIdSelective(Role entity) {
        return mapper.updateByPrimaryKeySelective(entity);
    }

}
